﻿using SQLite;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace YellowMap
{
    public class Favorite : BaseViewModel
    {
        [PrimaryKey]
        public string PlaceId { get; set; }
        public string Name { get; set; }
        public string SubCate { get; set; }
        public string Address { get; set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }


        string m_View, m_Search, m_Delete;

        public string Delete
        {
            get { return m_Delete; }
            set { m_Delete = value; this.NotifyPropertyChanged("Delete"); }
        }

        public string Search
        {
            get { return m_Search; }
            set { m_Search = value; this.NotifyPropertyChanged("Search"); }
        }

        public string View
        {
            get { return m_View; }
            set { m_View = value; this.NotifyPropertyChanged("View"); }
        }



    }

    public class History : BaseViewModel
    {
        [PrimaryKey]
        public string PlaceId { get; set; }
        public string Name { get; set; }
        public string SubCate { get; set; }
        public long Time { get; set; }
        public string StringTime
        {
            get
            {
                return (new DateTime(Time)).ToString("dd/MM/yyyy h:mm tt");
            }
        }
        private string[] StringDateTime
        {
            get
            {
                return Regex.Split(StringTime, " ");
            }
        }
        public string Date
        {
            get
            {
                return StringDateTime[0];
            }
        }
        public string Hours
        {
            get
            {
                return StringDateTime[1] + " " + StringDateTime[2];
                //return (Regex.Split(StringDateTime[1], ":"))[0] + ":" + (Regex.Split(StringDateTime[1], ":"))[1] + " " + StringDateTime[2];
            }
        }

        public string Address { get; set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }

        string m_View, m_Search;


        public string Search
        {
            get { return m_Search; }
            set { m_Search = value; this.NotifyPropertyChanged("Search"); }
        }

        public string View
        {
            get { return m_View; }
            set { m_View = value; this.NotifyPropertyChanged("View"); }
        }
    }

    public class Place
    {
        [PrimaryKey]
        public string PlaceId { get; set; }
        public double Lattitude { get; set; }
        public double Longitude { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string ReferenceId { get; set; }
        public string SubCate { get; set; }
    }

    public class Detail
    {
        [PrimaryKey]
        public string Id { get; set; }
        public string Image { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string FormatedPhoneNumber { get; set; }
        public string InternationalPhoneNumber { get; set; }

    }

    public class Step
    {
        public LocationPoint StartLocation { get; set; }
        public LocationPoint EndLocation { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string Instruction { get; set; }
        public DirectionIcon Icon { get; set; }
        public List<LocationPoint> Polyline { get; set; }
    }
}
